<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>订单详情</title>
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/base.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/mod.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/list.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/page.css" />
		<script src="{$staticHost}/static/js/jquery-1.8.3.min.js"></script>
		<script src="{$staticHost}/static/js/js.js"></script>
		<script src="{$staticHost}/static/js/mod.js"></script>
	</head>
	<body>
		<section id="con-box"></section>
		<script id="test" type="text/html">
		<% if(orderInfo.pay_status ==30){%>
			<div class="bg_skyblue ac f14 color-blue bold p10">
				退款中

			</div>
		<%}%>
		<% if(orderInfo.pay_status ==40){%>
			<div class="bg_skyblue ac f14 color-blue bold p10">
				已退款至原账户
				<p class="f14 pt10">请至支付宝中查看退款详情</p>
			</div>
		<%}%>
		<% if(orderInfo.status==3){%>
			<div class="bg_skyblue ac f14 color-blue bold p10">
				订单已取消
			</div>
		<%}%>

		<!-- 订单取消 -->

		<% if(orderInfo.status!=3){%>
		<div class="dns <%=orderInfo.dns%>">
			<% if(orderInfo.goodsType==1){%>
			<div class="ysp">
				<% if(orderInfo.pay_status==10){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					待付款

				</div>
				<%}%>
				<% if(orderInfo.pay_status==20){%>
					<div class="bg_skyblue ac f14 color-blue bold p10">
						已付款
						<p class="f14 pt10">待统计您的比赛结果</p>
					</div>
				<%}%>

			</div>
			<%}%>
			<!-- 有商品 -->
			<% if(orderInfo.goodsType==0){%>
			<div>
				<% if(orderInfo.pay_status==10){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					待付款
				</div>
				<%}%>
				<% if(orderInfo.pay_status==20){%>
					<div class="bg_skyblue ac f14 color-blue bold p10">
						已付款
					</div>
				<%}%>
			</div>
			<%}%>
			<!-- 无商品 付费活动 -->
		<%}%>
		</div>
		<!-- 未开始 -->

		<div class="start <%=orderInfo.start%>">
			<% if(orderInfo.goodsType==1||orderInfo.goodsType==0){%>
			<div class="ysp">
				<% if(orderInfo.pay_status==10){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					订单已失效

				</div>
				<%}%>
				<!-- 活动开始未付款 -->
			</div>
			<%}%>
			<!-- 活动开始后订单未付款 -->

			<% if(orderInfo.goodsType==0){%>
			<div class="ysp">
				<% if(orderInfo.pay_status==20&&orderInfo.status==4){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					已完成

				</div>
				<%}%>
			</div>
			<%}%>
			<!-- 活动开始后无商品订单已付款 -->
			<% if(orderInfo.goodsType==1){%>
			<div class="ysp">
				<% if(orderInfo.pay_status==20&&orderInfo.pay_status==1){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					等待发货
					<p class="f14 pt10">待统计您的比赛结果</p>
				</div>
				<%}%>
			</div>
			<%}%>
			<!-- 活动开始后有商品订单已付款 -->
			<!-- 活动开始后订单已付款 -->
		</div>
		<!-- 已开始 -->


		<div class="over <%=orderInfo.over%>" >

			<div class="ysp">

				<% if(orderInfo.status==1&&orderInfo.pay_status==20){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					等待发货
					<p class="f14 pt10">
						恭喜您获得<%=orderInfo.goods_name%>奖<br/>
						好霸气的奖牌已经亮瞎我的24k金氪眼
					</p>
				</div>
				<%}%>
				<!-- 等待发货 -->
				<% if(orderInfo.status==2&&orderInfo.pay_status==20){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					已发货
					<p class="f14 pt10">
						恭喜您获得<%=orderInfo.goods_name%>奖<br/>
						好霸气的奖牌已经亮瞎我的24k金氪眼
					</p>
				</div>
				<!-- 已发货 -->
				<%}%>
				<% if(orderInfo.pay_status==20&&orderInfo.status==4){%>
					<div class="bg_skyblue ac f14 color-blue bold p10">
						已完成
						<p class="f14 pt10">
							恭喜您获得<%=orderInfo.goods_name%>奖<br/>
							好霸气的奖牌已经亮瞎我的24k金氪眼
						</p>
					</div>
				<%}%>
				<% if(orderInfo.pay_status==10){%>
				<div class="bg_skyblue ac f14 color-blue bold p10">
					订单已失效

				</div>
				<%}%>

			</div>

		</div>
		<!-- 已结束 -->

		<!-- 判断活动状态 -->


		<div class="recipients line-gray-bottom">
			<%=orderInfo.name%> <span class="pl20"><%=orderInfo.phone%></span>
			<%if(orderInfo.goodsType==1){%>
			<p><%=orderInfo.address%></p>
			<%}%>
		</div>

			<!-- 收货详细信息 -->
			<div class="pr line-gray-bottom">
				<a href="{$staticHost}/show/logistics?num=<%=orderInfo.shipping_num%>&code=<%=orderInfo.shipping_code%>"></a>
				<ul class="wljs-list" style="padding-left:10px;">

				    <li>
				    	物流公司
				      	<span>韵达快递</span>
				    </li>
					<li>
				      	快递单号
				      	<span>7r87432942b</span>
				    </li>
				    <!--  <li>
				      	联系电话
				      	<span>400-1233-5667</span>
				    </li> -->
				 </ul>
			 </div>
			 <!-- 物流单位  信息  记得增加js跳转   减少代码层次 -->
			 <p class="line-gray-bottom p10 f14">
				报名费
				<span class="color-blue fr"><%=orderInfo.shipping_fee%>元</span>
			</p>
			<ul class="line-gray-bottom order-xq">

				<li class="square-img">
					<img src="<%=orderInfo.thumb%>" />
					<ol>
						<li>
							<%=orderInfo.goods_name%>
							<span>￥<%=orderInfo.price%></span>
						</li>
						<li class="pt-10">
							<%=orderInfo.subTtitle%>
							<span>X<%=orderInfo.num%></span>
						</li>
					</ol>
				</li>
				<li class="square-img">
					<img src="<%=orderInfo.thumb%>" />
					<ol>
						<li>
							<%=orderInfo.goods_name%>
							<span>￥<%=orderInfo.price%></span>
						</li>
						<li class="pt-10">
							<%=orderInfo.subTtitle%>
							<span>X<%=orderInfo.num%></span>
						</li>
					</ol>
				</li>
			</ul>

			<div class="p15 clearfix lh30 line-gray-bottom f16">
				<p>
					运费
					<span class="fr">￥<%=orderInfo.shipping_fee%></span>
				</p>
				<p>
					纪念品折扣
					<span class="fr">9折</span>
				</p>
				<p class="fr">合计：￥<em class="color-blue"><%=orderInfo.total_fee%></em></p>
			</div>
			<div class="p10 lh34 line-gray-bottom clearfix f16">
				<p>
					应付
					<span class="fr">19+234X0.9=0000</span>
				</p>
				<p>实付 <span class="color-blue fr"> <%=orderInfo.total_fee%></span></p>
			</div>

			<div class="p10 lh30 f14 color_gray mb50">
				订单号码　<%=orderInfo.order_id%><br/>
				创建时间　<%=orderInfo.addtime%><br/>
				<% if(orderInfo.pay_status==20){%><%}%>
					支付时间　<%=orderInfo.updatetime%><br/>
					支付流水账号：　<%=orderInfo.updatetime%><br/>

				发货时间<%=orderInfo.order_id%><br/>
				完成时间<%=orderInfo.addtime%>

			</div>
			<a class="dow-app color-blue" href="http://mobile.hupu.com/download/joggers?r=share">
	            确认收货
	        </a>
		</script>
	</body>
	<script>

		var order_id = "{$oid}";
		$(function(){
			$.getJSON('{$staticHost}/orderWeb/orderDetail',{order_id:"201609141942005648"}, function(data, error) {
			
				console.log(data);
				var info=formatActivityData(data.orderInfo)
				var d = new Date(parseInt(info.stime) * 1000);
				info.stime =d.getFullYear()+"."+xs(d.getMonth()+1)+"."+xs(d.getDate())+ " "+xs( d.getHours())+":"+xs(d.getMinutes());
				var q = new Date(parseInt(info.etime) * 1000);
				info.etime =q.getFullYear()+"."+xs(q.getMonth()+1)+"."+xs(q.getDate())+ " "+xs(d.getHours())+":"+xs(d.getMinutes());
				function xs(n){ return n<10?("0"+n):n;}
				var html = template('test', data);
				document.getElementById('con-box').innerHTML = html;
			})
		// 	/***加载数据***/
	});
		function formatActivityData(info) {
			if(info) {
				console.log(info.addtime);
				var timestamp = Date.parse(new Date()).toString();
				 timestamp = timestamp.substr(0,10)
				if(info.stime > timestamp){
					console.log("1e");
					info.dns='db';
					info.start='dn';
					info.over='dn';
				}else if(timestamp > info.stime && timestamp < info.etime){
					console.log("2");
					info.dns='dn';
					info.start='db';
					info.over='dn';
				}else if(info.etime < timestamp){
					info.dns='dn';
					info.start='dn';
					info.over='db';
				}

			return info;
			}
		}
		/***判断订单状态***/

	</script>
{template 'show/web-footer'}
